#!/bin/sh
if [ ! -f /initialized ]; then {
	touch /initialized
	if [ $TRACKER_PORT ]; then	 #tracker端口
		sed -i "s#\(^port\).*#\1=$TRACKER_PORT#" /etc/fdfs/tracker.conf
	fi
	if [ $TRACKER_BASE_PATH ]; then	 #tracker存储log或者data
		sed -i "s#\(^base_path\).*#\1=$TRACKER_PORT#" /etc/fdfs/tracker.conf
	fi
}
fi
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
if [ $TRACKER_BASE_PATH ]; then	
	tail -f $TRACKER_BASE_PATH/logs/trackerd.log
else 
	tail -f /home/yuqing/fastdfs/logs/trackerd.log
fi

